<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>Phonon.MediaController Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">Phonon.MediaController Class Reference<br /><sup><sup>[<a href="phonon.html">phonon</a> module]</sup></sup></h1><p>The MediaController class controls optional features of a media
file/device. <a href="#details">More...</a></p>

<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="phonon-mediacontroller.html#Feature-enum">Feature</a></b> { Angles, Chapters, Titles }</li><li><div class="fn" />class <b><a href="phonon-mediacontroller-features.html">Features</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="phonon-mediacontroller.html#MediaController">__init__</a></b> (<i>self</i>, MediaObject&#160;<i>parent</i>)</li><li><div class="fn" />bool <b><a href="phonon-mediacontroller.html#autoplayTitles">autoplayTitles</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-mediacontroller.html#availableAngles">availableAngles</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-Phonon.AudioChannelDescription <b><a href="phonon-mediacontroller.html#availableAudioChannels">availableAudioChannels</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-mediacontroller.html#availableChapters">availableChapters</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-Phonon.SubtitleDescription <b><a href="phonon-mediacontroller.html#availableSubtitles">availableSubtitles</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-mediacontroller.html#availableTitles">availableTitles</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-mediacontroller.html#currentAngle">currentAngle</a></b> (<i>self</i>)</li><li><div class="fn" />AudioChannelDescription <b><a href="phonon-mediacontroller.html#currentAudioChannel">currentAudioChannel</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-mediacontroller.html#currentChapter">currentChapter</a></b> (<i>self</i>)</li><li><div class="fn" />SubtitleDescription <b><a href="phonon-mediacontroller.html#currentSubtitle">currentSubtitle</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-mediacontroller.html#currentTitle">currentTitle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#nextTitle">nextTitle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#previousTitle">previousTitle</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#setAutoplayTitles">setAutoplayTitles</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#setCurrentAngle">setCurrentAngle</a></b> (<i>self</i>, int&#160;<i>angleNumber</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#setCurrentAudioChannel">setCurrentAudioChannel</a></b> (<i>self</i>, AudioChannelDescription&#160;<i>stream</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#setCurrentChapter">setCurrentChapter</a></b> (<i>self</i>, int&#160;<i>chapterNumber</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#setCurrentSubtitle">setCurrentSubtitle</a></b> (<i>self</i>, SubtitleDescription&#160;<i>stream</i>)</li><li><div class="fn" /><b><a href="phonon-mediacontroller.html#setCurrentTitle">setCurrentTitle</a></b> (<i>self</i>, int&#160;<i>titleNumber</i>)</li><li><div class="fn" />Features <b><a href="phonon-mediacontroller.html#supportedFeatures">supportedFeatures</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#angleChanged">angleChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#availableAnglesChanged">availableAnglesChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#availableAudioChannelsChanged">availableAudioChannelsChanged</a></b> ()</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#availableChaptersChanged">availableChaptersChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#availableSubtitlesChanged">availableSubtitlesChanged</a></b> ()</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#availableTitlesChanged">availableTitlesChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#chapterChanged">chapterChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="phonon-mediacontroller.html#titleChanged">titleChanged</a></b> (int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The MediaController class controls optional features of a media
file/device.</p>
<p>Some media sources have content that the <a href="phonon-mediaobject.html">MediaObject</a> does not provide control
over, for instance, chapters in a DVD file. The functionality the
media controller offers is dependent on the type of media source
that is played back. Commonly, the media controller allows you
to:</p>
<ul>
<li>Navigate between <b>chapters</b>.</li>
<li>Navigate between <b>titles</b>.</li>
<li>Select between <b>angles</b>.</li>
</ul>
<p>The <a href="phonon-mediacontroller.html#Feature-enum">Feature</a> enum
explains these terms in more detail, and their context in playback
of CD and DVD.</p>
<p>The media controller keeps a <a href="phonon-mediaobject.html">MediaObject</a>, of which <a href="phonon-mediaobject.html#currentSource">media source</a> is played
back. You can still call the media object's functions, e.g.,
<a href="phonon-mediaobject.html#stop">stop()</a>; this is all
handled correctly by the media controller. You have the option of
letting the media controller play all titles of a source in
sequence by setting the <a href="phonon-mediacontroller.html#autoplayTitles">autoplay titles</a>
option.</p>
<p>To start a playback using a media object, you call <a href="phonon-mediaobject.html#play">play()</a> on the media object. To
play a specific title, use <a href="phonon-mediacontroller.html#setCurrentTitle">setCurrentTitle</a>()
and then call <a href="phonon-mediaobject.html#play">play()</a>.</p>
<p><b>Warning:</b> The Phonon.MediaController class is not yet
supported by Qt backends.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Feature-enum" />MediaController.Feature</h3><p>The values of this enum are interpreted differently depending on
the type of media source, e.g., DVD or CD. We give examples for
these sources.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.MediaController.Angles</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">In the VOB (DVD) format, it is possible to to
give several video streams of the same scene, each of which
displays the scene from a different angle. The DVD viewer can then
change between these angles.</td>
</tr>
<tr>
<td class="topAlign">
<tt>Phonon.MediaController.Chapters</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">In the VOB format, chapters are points in a
single video stream that can be played and seeked to
separately.</td>
</tr>
<tr>
<td class="topAlign"><tt>Phonon.MediaController.Titles</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">On a CD, a title is a separate sound track. On
DVD, a title is a separate VOB file.</td>
</tr>
</table>
<p>The Features type is a typedef for <a href="qflags.html">QFlags</a>&lt;Feature&gt;. It stores an OR
combination of Feature values.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="MediaController" />MediaController.__init__ (<i>self</i>, <a href="phonon-mediaobject.html">MediaObject</a>&#160;<i>parent</i>)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new <a href="phonon-mediacontroller.html">MediaController</a> with the media
object (<i>parent</i>) to be used by the media controller.</p>
<p><b>See also</b> <a href="phonon-mediaobject.html">MediaObject</a> and <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="autoplayTitles" />bool MediaController.autoplayTitles (<i>self</i>)</h3><p>Returns true if titles will automatically be played when the
media is played; otherwise returns false.</p>
<p>The media controller will play the titles of the media source in
sequence when the media object's <a href="phonon-mediaobject.html#play">play()</a> function is called. If
the autoplay option is disabled, the media object will play the
<a href="phonon-mediacontroller.html#currentTitle">MediaController.currentTitle()</a>{current
title} and then finish the playback.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#setAutoplayTitles">setAutoplayTitles</a>()
and <a href="phonon-mediacontroller.html#currentTitle">currentTitle</a>().</p>


<h3 class="fn"><a name="availableAngles" />int MediaController.availableAngles (<i>self</i>)</h3><p>Returns the available angles that is available for the current
media source.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="availableAudioChannels" />list-of-Phonon.AudioChannelDescription MediaController.availableAudioChannels (<i>self</i>)</h3><h3 class="fn"><a name="availableChapters" />int MediaController.availableChapters (<i>self</i>)</h3><p>Returns the number of chapters the current media source
contains.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="availableSubtitles" />list-of-Phonon.SubtitleDescription MediaController.availableSubtitles (<i>self</i>)</h3><h3 class="fn"><a name="availableTitles" />int MediaController.availableTitles (<i>self</i>)</h3><p>Returns the number of titles that the current media source
contains.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="currentAngle" />int MediaController.currentAngle (<i>self</i>)</h3><p>Returns the angle that is currently used.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#setCurrentAngle">setCurrentAngle</a>()
and <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="currentAudioChannel" /><a href="phonon-audiochanneldescription.html">AudioChannelDescription</a> MediaController.currentAudioChannel (<i>self</i>)</h3><h3 class="fn"><a name="currentChapter" />int MediaController.currentChapter (<i>self</i>)</h3><p>Returns the chapter that is currently being played back.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#setCurrentChapter">setCurrentChapter</a>()
and <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="currentSubtitle" /><a href="phonon-subtitledescription.html">SubtitleDescription</a> MediaController.currentSubtitle (<i>self</i>)</h3><h3 class="fn"><a name="currentTitle" />int MediaController.currentTitle (<i>self</i>)</h3><p>Returns the title that is currently played back.</p>
<p>The current title is 0 (the first) by default.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#setCurrentTitle">setCurrentTitle</a>()
and <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="nextTitle" />MediaController.nextTitle (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void nextTitle()</tt>.</p><p>Skips to the next title.</p>
<p>If it was playing before the title change it will start playback
on the next title if autoplayTitles is enabled.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="previousTitle" />MediaController.previousTitle (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void previousTitle()</tt>.</p><p>Skips to the previous title.</p>
<p>If it was playing before the title change it will start playback
on the previous title if autoplayTitles is enabled.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="setAutoplayTitles" />MediaController.setAutoplayTitles (<i>self</i>, bool)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setAutoplayTitles(bool)</tt>.</p><p>Sets the titles to play automatically when the media is played
if <i>enable</i> is true; otherwise disables this option.</p>
<p>The media controller will play the titles of the media source in
sequence when the media object's <a href="phonon-mediaobject.html#play">play()</a> function is called. If
the autoplay option is disabled, the media object will play the
<a href="phonon-mediacontroller.html#currentTitle">MediaController.currentTitle()</a>{current
title} and then finish the playback.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#autoplayTitles">autoplayTitles</a>()
and <a href="phonon-mediacontroller.html#currentTitle">currentTitle</a>().</p>


<h3 class="fn"><a name="setCurrentAngle" />MediaController.setCurrentAngle (<i>self</i>, int&#160;<i>angleNumber</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentAngle(int)</tt>.</p><p>Sets the current angle to the given <i>angleNumber</i> if the
media file or device supports navigation by angle number.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#currentAngle">currentAngle</a>() and
<a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="setCurrentAudioChannel" />MediaController.setCurrentAudioChannel (<i>self</i>, <a href="phonon-audiochanneldescription.html">AudioChannelDescription</a>&#160;<i>stream</i>)</h3><h3 class="fn"><a name="setCurrentChapter" />MediaController.setCurrentChapter (<i>self</i>, int&#160;<i>chapterNumber</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentChapter(int)</tt>.</p><p>Sets the current chapter to the given <i>chapterNumber</i> if
the media file or device supports navigation by chapter number.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#currentChapter">currentChapter</a>()
and <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="setCurrentSubtitle" />MediaController.setCurrentSubtitle (<i>self</i>, <a href="phonon-subtitledescription.html">SubtitleDescription</a>&#160;<i>stream</i>)</h3><h3 class="fn"><a name="setCurrentTitle" />MediaController.setCurrentTitle (<i>self</i>, int&#160;<i>titleNumber</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentTitle(int)</tt>.</p><p>Skips to the given title <i>titleNumber</i>.</p>
<p>If it was playing before the title change it will start playback
on the new title if autoplayTitles is enabled.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#currentTitle">currentTitle</a>() and
<a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="supportedFeatures" /><a href="phonon-mediacontroller-features.html">Features</a> MediaController.supportedFeatures (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="angleChanged" />void angleChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the current angle changes. The
new angle number is given by <i>angleNumber</i>.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="availableAnglesChanged" />void availableAnglesChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the number of available angles
changes. The new number of available angles is given by
<i>availableAngles</i>.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="availableAudioChannelsChanged" />void availableAudioChannelsChanged ()</h3><p>This is the default overload of this signal.</p><h3 class="fn"><a name="availableChaptersChanged" />void availableChaptersChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the number of available chapters
changes. The new number of available chapters is given by
<i>availableChapters</i>.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="availableSubtitlesChanged" />void availableSubtitlesChanged ()</h3><p>This is the default overload of this signal.</p><h3 class="fn"><a name="availableTitlesChanged" />void availableTitlesChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the number of available titles
changes. The new number of available titles is given by
<i>availableTitles</i>.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="chapterChanged" />void chapterChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the current chapter changes. The
new chapter number is given by <i>chapterNumber</i>.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>


<h3 class="fn"><a name="titleChanged" />void titleChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the current title changes. The
new title number is given by <i>titleNumber</i>.</p>
<p><b>See also</b> <a href="phonon-mediacontroller.html#Feature-enum">Feature</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>